<?php
require_once 'init.inc';
require_once 'cf/gallery.inc';
require_once 'cf/image.inc';

$title = 'Фото альбомы';

$albumsObj = new GalleryAlbums;

$albums = $albumsObj->toArray();

$albumImages = array();
foreach ($albumsObj as $album) 
{
	if ($album->image()) 
	{
		$thumb = new Thumbnail($album->image(), 250, 150);
		$albumImages[] = $thumb->toArray();
	}
	else 
	{
		$albumImages[] = false;
	}
}

assignTemplateVars('title','albums','albumImages');
display('gallery');
?>